home *** CD-ROM | disk | FTP | other *** search
- function init_movie()
- {
- _g = _global;
- _g.cdYearFull = 2005;
- _g.shortlistObj = new Object();
- _g.gClipLevel = 500;
- _g.gCriteria_xml = new XML();
- _g.gHelp = new Array();
- _g.gCriteria_list = new Array();
- _g.gSearch_Results_Criteria_list = new Array("distance","name","school_type","school_subtype","st_ranking" + String(_g.cdYearFull).substring(2,4),"st_ranking" + String(_g.cdYearFull - 1).substring(2,4),"town","entry_gender","posx","posy","unique_id");
- _g.gNavActive = "home";
- _g.gGlobalSearch = false;
- var _loc2_ = new Object();
- _loc2_.name = "shortlist";
- _g.gShortlist = data_load(_loc2_);
- if(_g.gShortlist == undefined)
- {
- _loc2_ = new Object();
- _loc2_.name = "shortlist";
- _loc2_.schools = new Array();
- data_save(_loc2_);
- _g.gShortlist = data_load(_loc2_);
- }
- var _loc1_ = new Object();
- _loc1_.name = "pingData";
- _g.gPingData = so_load(_loc1_);
- if(_g.gPingData == undefined)
- {
- _loc1_ = createUserID();
- _loc1_.name = "pingData";
- so_save(_loc1_);
- }
- else
- {
- _loc1_ = _g.gPingData;
- _loc1_.time = getTimeStamp();
- _loc1_.firstTimeIssueRun = false;
- so_save(_loc1_);
- }
- var _loc3_ = "cd=" + _loc1_.cd + "&u=" + _loc1_.userID + "&t=" + _loc1_.time + "&firstTime=" + _loc1_.firstTimeIssueRun;
- sendPingData(_loc3_);
- pingInterval = setInterval(sendPingData,60000,_loc3_);
- getUrl("lingo:Flsh_getPlatform", "");
- _g.ebterms = false;
- _g.hcterms = false;
- }
- function sendPingData(str)
- {
- getURL("lingo:Flsh_sendPing(\"" + str + "\")","");
- }
- function clearPingData()
- {
- clearInterval(pingInterval);
- }
- function setPlatform(str)
- {
- _g.platform = str;
- }
- function enableFooter()
- {
- header.mcDisabler._visible = false;
- header.exit_btn.gotoAndStop("off");
- }
- function xml_load(xmlDoc)
- {
- _g.gCriteria_xml.load(xmlDoc);
- _g.gCriteria_xml.onLoad = xml_parse;
- }
- function xml_parse()
- {
- var data = _g.gCriteria_xml;
- data.ignoreWhite = true;
- data.parseXML(data);
- var len = _g.gCriteria_xml.childNodes[0].childNodes.length;
- var _loc1_ = 0;
- while(_loc1_ < len)
- {
- var attribArray = new Array();
- var _loc3_ = _g.gCriteria_xml.childNodes[0].childNodes[_loc1_].attributes.id;
- var fieldsize = _g.gCriteria_xml.childNodes[0].childNodes[_loc1_].attributes.fieldsize;
- var fieldtype = _g.gCriteria_xml.childNodes[0].childNodes[_loc1_].attributes.fieldtype;
- attribArray.push(_loc3_,fieldsize,fieldtype);
- if(_loc3_ != "")
- {
- _g.gCriteria_list.push(attribArray);
- }
- _loc1_ = _loc1_ + 1;
- }
- var len = _g.gCriteria_xml.childNodes[1].childNodes.length;
- _loc1_ = 0;
- while(_loc1_ < len)
- {
- var _loc2_ = new Object();
- _loc2_.id = _loc1_;
- _loc2_.title = _g.gCriteria_xml.childNodes[1].childNodes[_loc1_].childNodes[0].firstChild.nodeValue;
- _loc2_.content = _g.gCriteria_xml.childNodes[1].childNodes[_loc1_].childNodes[1].firstChild.nodeValue;
- if(_loc3_ != "")
- {
- _g.gHelp.push(_loc2_);
- }
- _loc1_ = _loc1_ + 1;
- }
- }
- function movie_load(id, clipID, x, y)
- {
- if(clipID == undefined)
- {
- if(!content._name)
- {
- createEmptyMovieClip("content",_g.gClipLevel++);
- }
- if(content._url.indexOf(id) == -1)
- {
- if(x || y)
- {
- content._x = x;
- content._y = y;
- }
- content.loadMovie(id);
- }
- }
- else
- {
- createEmptyMovieClip(clipID,_g.gClipLevel++);
- clipID = eval(clipID);
- if(x || y)
- {
- clipID._x = x;
- clipID._y = y;
- }
- clipID.loadMovie(id);
- }
- return true;
- }
- function data_save(oData)
- {
- var _loc1_ = oData;
- trace("* data_save()");
- for(var _loc2_ in _g[_loc1_.name + "Obj"].obj)
- {
- trace("-- " + _loc2_ + ": " + _g[_loc1_.name + "Obj"].obj);
- }
- _g[_loc1_.name + "Obj"].obj = _loc1_;
- }
- function data_load(oData)
- {
- var _loc1_ = oData;
- trace("* data_load()");
- for(var _loc2_ in _g[_loc1_.name + "Obj"].obj)
- {
- trace("-- " + _loc2_ + ": " + _g[_loc1_.name + "Obj"].obj);
- }
- return _g[_loc1_.name + "Obj"].obj;
- }
- function so_save(oData)
- {
- trace("* so_save()");
- var _loc1_ = SharedObject.getLocal(oData.name);
- _loc1_.data.obj = oData;
- }
- function so_load(oData)
- {
- trace("* so_load()");
- var _loc1_ = SharedObject.getLocal(oData.name);
- return _loc1_.data.obj;
- }
- function shortlist_school(school_id, id)
- {
- var i = 0;
- while(i < _g.gShortlist.schools.length)
- {
- if(_g.gShortlist.schools[i].length < 1)
- {
- _g.gShortlist.schools.splice(i,1);
- }
- i++;
- }
- var shortlist = _g.gShortlist.schools.toString();
- if(_g.gShortlist.schools.toString().indexOf(school_id) >= 0)
- {
- var i = 0;
- while(i < _g.gShortlist.schools.length)
- {
- if(_g.gShortlist.schools[i] == school_id)
- {
- _g.gShortlist.schools.splice(i,1);
- }
- i++;
- }
- eval(id).gotoAndPlay("inactive");
- }
- else
- {
- _g.gShortlist.schools.push(school_id);
- eval(id).gotoAndPlay("active");
- }
- var obj = new Object();
- obj.name = "shortlist";
- obj.schools = _g.gShortlist.schools;
- data_save(obj);
- }
- function getTimeStamp()
- {
- var _loc2_ = function(nm)
- {
- var _loc1_ = nm;
- _loc1_ = _loc1_.toString();
- if(_loc1_.length != 1)
- {
- return _loc1_;
- }
- return "0" + _loc1_;
- };
- var _loc1_ = new Date();
- var _loc3_ = "" + _loc2_(_loc1_.getUTCDate()) + "." + _loc2_(_loc1_.getUTCMonth() + 1) + "." + _loc1_.getUTCFullYear() + "_" + _loc2_(_loc1_.getUTCHours()) + "." + _loc2_(_loc1_.getUTCMinutes()) + "." + _loc2_(_loc1_.getUTCSeconds());
- return _loc3_;
- }
- function colour_change(id, colorTransform)
- {
- id = eval(id);
- var col = new Color(id);
- col.setTransform(colorTransform);
- }
- function nav_activate(id, clip)
- {
- help_remove();
- search_in_progress_remove();
- _g.gNavActive = id;
- var navArray = new Array("home","league_tables","schools_of_year","search","shortlist","links");
- var i = 0;
- while(i < navArray.length)
- {
- if(navArray[i] == id)
- {
- eval("nav." + navArray[i]).gotoAndPlay("down");
- }
- else
- {
- eval("nav." + navArray[i]).gotoAndPlay("up");
- }
- i++;
- }
- }
- function help_preview_view(id, clip, strInsertPos, xOffset, yOffset, absoluteX, absoluteY)
- {
- var _loc1_ = id;
- var _loc2_ = this;
- attachMovie("bubble_help","bubble_help",_g.gClipLevel++);
- if(strInsertPos != null)
- {
- bubble_help.gotoAndStop(strInsertPos);
- }
- _loc2_.loc = new Object();
- _loc2_.loc.x = clip._x;
- _loc2_.loc.y = clip._y;
- if(xOffset != null)
- {
- _loc2_.loc.x += xOffset;
- }
- if(yOffset != null)
- {
- _loc2_.loc.y += yOffset;
- }
- if(absoluteX)
- {
- _loc2_.loc.x = absoluteX;
- }
- if(absoluteY)
- {
- _loc2_.loc.y = absoluteY;
- }
- clip._parent.localToGlobal(loc);
- _loc2_.globalToLocal(loc);
- bubble_help._x = _loc2_.loc.x + clip._width;
- bubble_help._y = _loc2_.loc.y + clip._height;
- bubble_help.title.autoSize = true;
- trace("*******************************");
- for(var _loc3_ in _g.gHelp[_loc1_ - 1])
- {
- trace(_loc3_ + ": " + _g.gHelp[_loc1_ - 1][_loc3_]);
- }
- trace("*******************************");
- if(typeof _loc1_ == "number")
- {
- bubble_help.title.text = _g.gHelp[_loc1_ - 1].title;
- }
- else
- {
- bubble_help.title.text = _loc1_.title;
- bubble_help.more_info.text = _loc1_.more_info;
- }
- var width = bubble_help.title._width <= bubble_help.more_info._width ? bubble_help.more_info._width : bubble_help.title._width;
- bubble_help.bg2._width = width;
- if(strInsertPos == "top-right" || strInsertPos == "bottom-right")
- {
- bubble_help.bg2._x = bubble_help.bg3._x - bubble_help.bg2._width;
- bubble_help.bg1._x = Math.ceil(bubble_help.bg2._x - bubble_help.bg1._width);
- bubble_help.title._x = bubble_help.more_info._x = bubble_help.bg2._x;
- }
- else
- {
- bubble_help.bg3._x = Math.floor(bubble_help.bg2._x + bubble_help.bg2._width);
- }
- }
- function help_view(id, clip)
- {
- var _loc1_ = id;
- trace("* help_view()");
- var _loc3_ = undefined;
- var _loc2_ = undefined;
- var more_text = "";
- bubble_help.removeMovieClip();
- attachMovie("interface_disable","interface_disable",_g.gClipLevel++,{_x:0,_y:140});
- interface_disable.onRollOver = function()
- {
- };
- interface_disable.useHandCursor = false;
- attachMovie("help_box","help_box",_g.gClipLevel++,{_x:161,_y:196});
- help_box.title.autoSize = true;
- help_box.content.autoSize = true;
- help_box.content.multiline = true;
- if(typeof _loc1_ == "number")
- {
- _loc3_ = _g.gHelp[_loc1_ - 1].title;
- }
- else
- {
- _loc3_ = _loc1_.title;
- }
- if(typeof _loc1_ == "number")
- {
- _loc2_ = _g.gHelp[_loc1_ - 1].content;
- }
- else
- {
- _loc2_ = _loc1_.content;
- }
- if(_loc1_.more_info)
- {
- more_text = _loc1_.more_info;
- }
- trace("title_text : " + _loc3_);
- trace("body_text : " + _loc2_);
- help_box.title.text = _loc3_;
- help_box.content.htmlText = _loc2_;
- help_box.more_info = more_text;
- help_box.bg2._height = help_box.content._height + (help_box.content._y - help_box.bg2._y) + 45;
- help_box.bg3._y = help_box.bg2._y + help_box.bg2._height;
- help_box.b_close._y = help_box.bg3._y - 30;
- }
- function help_preview_remove()
- {
- bubble_help.removeMovieClip();
- }
- function help_remove()
- {
- interface_disable.removeMovieClip();
- help_box.removeMovieClip();
- bubble_help.removeMovieClip();
- }
- function dialogue_add(title, txt, y)
- {
- var _loc1_ = y;
- trace("dialogue_add:" + title + txt + _loc1_);
- attachMovie("interface_disable","interface_disable",_g.gClipLevel++,{_x:0,_y:140});
- interface_disable.onRollOver = function()
- {
- };
- interface_disable.useHandCursor = false;
- if(!_loc1_)
- {
- _loc1_ = 196;
- }
- attachMovie("help_box","dialogue_box",_g.gClipLevel++,{_x:161,_y:_loc1_});
- dialogue_box.title.autoSize = true;
- dialogue_box.title.text = title;
- dialogue_box.content.autoSize = true;
- dialogue_box.content.htmlText = txt;
- dialogue_box.bg2._height = dialogue_box.content._height + (dialogue_box.content._y - dialogue_box.bg2._y) + 45;
- dialogue_box.bg3._y = dialogue_box.bg2._y + dialogue_box.bg2._height;
- dialogue_box.b_close._y = dialogue_box.bg3._y - 30;
- dialogue_box.b_close.onRelease = function()
- {
- dialogue_remove();
- };
- }
- function dialogue_remove()
- {
- trace("* dialogue_remove()");
- interface_disable.removeMovieClip();
- dialogue_box.removeMovieClip();
- }
- function show_report_panel(o)
- {
- attachMovie("interface_disable","interface_disable",_g.gClipLevel++,{_x:0,_y:140});
- interface_disable.onRollOver = function()
- {
- };
- interface_disable.useHandCursor = false;
- attachMovie("report_clp","report_clp",_g.gClipLevel++,{_x:161,_y:196,oInit:o});
- }
- function remove_report_panel()
- {
- interface_disable.removeMovieClip();
- report_clp.removeMovieClip();
- }
- function search_in_progress_view()
- {
- content.enabled = false;
- help_preview_remove();
- interface_disable.removeMovieClip();
- updateAfterEvent();
- attachMovie("interface_disable","interface_disable",_g.gClipLevel++,{_x:0,_y:140});
- attachMovie("search_in_progress","search_in_progress",500000,{_x:261,_y:276});
- interface_disable.onRollOver = function()
- {
- };
- interface_disable.useHandCursor = false;
- updateAfterEvent();
- }
- function search_in_progress_remove()
- {
- interface_disable.removeMovieClip();
- search_in_progress.removeMovieClip();
- updateAfterEvent();
- }
- function schools_search_from_feature(search)
- {
- content.school_info.removeMovieClip();
- content.search.removeMovieClip();
- content.gotoAndPlay(1);
- content.removeMovieClip();
- searchMovieFunction = "search";
- content.school_info.removeMovieClip();
- nav_activate("search");
- _g.gGlobalSearch = search;
- movie_load("search.swf");
- }
- XML.prototype.ignoreWhite = true;
- XMLnode.prototype.byName = function(name)
- {
- var _loc3_ = this.childNodes.length;
- var _loc1_ = 0;
- while(_loc1_ < _loc3_)
- {
- var _loc2_ = this.childNodes[_loc1_];
- if(_loc2_.nodeName == name)
- {
- return _loc2_;
- }
- _loc1_ = _loc1_ + 1;
- }
- return null;
- };
- XMLnode.prototype.getText = function()
- {
- return this.firstChild.nodeValue;
- };
- XMLnode.prototype.byPath = function(path)
- {
- var _loc1_ = this;
- var arrPath = path.split("/");
- var len = arrPath.length;
- var _loc3_ = 0;
- while(_loc3_ < len)
- {
- var _loc2_ = arrPath[_loc3_];
- if(_loc2_.charAt(0) == "@")
- {
- _loc1_ = _loc1_.byID(_loc2_.substring(1));
- }
- else if(_loc2_.charAt(0) == "#")
- {
- _loc1_ = _loc1_.byIndex(parseInt(_loc2_.substring(1)));
- }
- else
- {
- _loc1_ = _loc1_.byName(_loc2_);
- }
- if(!_loc1_)
- {
- }
- _loc3_ = _loc3_ + 1;
- }
- return _loc1_;
- };
- _global.lingo = function(str)
- {
- if(CustomActions == null && $version.toString().substring(4,5) == "7" == false)
- {
- getURL("lingo:" + str,"");
- }
- };
- _global.fileXML = new XML();
- fileXML.onLoad = function()
- {
- _global.downloads = this.byPath("downloads");
- };
- fileXML.load("file.xml");
- var createUserID = function()
- {
- var _loc1_ = new Object();
- var _loc2_ = Math.random().toString().substr(2,7) + "" + Math.random().toString().substr(2,7);
- if(_g.gPingData.data.firstTimeIssueRun == null)
- {
- firstTime = true;
- _loc1_.firstTimeIssueRun = false;
- }
- else
- {
- firstTime = false;
- }
- _loc1_.cd = "20" + String(_g.cdYearFull).substring(2,3);
- _loc1_.userID = _loc2_;
- _loc1_.firstTimeIssueRun = firstTime;
- _loc1_.time = getTimeStamp();
- return _loc1_;
- };
- init_movie();
- xml_load("criteria.xml");
- movie_load("header.swf","header");
- movie_load("navigation.swf","nav",0,108);
- movie_load("home.swf");
-